package com.stockz.ui.swing.charting.util;

public class DisplayUtil {

	public static String format(double max){
		String letter = null;
		double devisor = 1;
		if(max > 1000000000){
			letter = "B";
			devisor = 1000000000;
		}else if(max > 1000000){
			letter = "M";
			devisor = 1000000;
		}else if(max > 1000){
			letter = "K";
			devisor = 1000;
		}
		if(letter != null){
			return UIChartingConstant.volumeNumberFormat.format(max/devisor)+letter;
		}
		return UIChartingConstant.volumeNumberFormat.format(max);
	}
	
}
